package com.example.springboot_system.Controller;

import com.example.springboot_system.service.AnnounceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
public class PageController {
    @Autowired
    private AnnounceService announceService;

    @RequestMapping("/register")
    public String toReg() {
        return "register";
    }


    @GetMapping("/outpatientToll")
    public String outpatientToll() {
        return "toll/outpatientToll";
    }

    @GetMapping("/examinationToll")
    public String examinationToll() {
        return "toll/examinationToll";
    }

    @GetMapping("/404")
    public String page404() {
        return "404";
    }

    @GetMapping("/takingdrug")
    public String takingdrug() {
        return "takingdrug/takingdrug";
    }

    @GetMapping("/announcement")
    public String announcement(HttpSession session) {
        announceService.findAllAnnounce(session);
        return "/announcement";
    }

    @GetMapping("/outpatient")
    public String outpatient(HttpSession session) {
        announceService.findAllAnnounce(session);
        return "/outpatient/outpatient";
    }

    @GetMapping("/medicalExamination")
    public String medicalExamination(HttpSession session) {
        announceService.findAllAnnounce(session);
        return "/medicalExamination/medicalExamination";
    }
}